#include <iostream>
#include <signal.h>
#include <unistd.h>

using namespace std;

void handler(int signo)
{
    cout<<"get a signo: "<<signo << endl;
    sleep(20);
}

int main()
{

    struct sigaction act, oact;

    act.sa_handler = handler;
    act.sa_flags = 0;
    sigemptyset(&act.sa_mask);

    sigaction(SIGINT,&act,&oact);

    while(1)
    {
        sleep(1);
    }

    return 0;
}


